home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / LISP Related / MCL 2.0b1 Patches / MCL 2.0b1 Source Patches / scroll-bar-dlg-items-patch.lisp < prev    next >
Encoding:
Text File  |  1991-04-02  |  2.0 KB  |  48 lines  |  [TEXT/CCL2]

  1.  
  2. ;This code is already loaded when MCL 2.0b1 starts up and the following patches
  3. ; are also included in the patch2 (.fasl) file. The following source patch is
  4. ; provided so that the source in the library file is consistent with the
  5. ; behavior of MCL 2.0b1p2.
  6.  
  7. ;The install-view-in-window method was called without focusing for drawing.
  8. ;We fixed it by making the scroll bar be initially invisible (this is
  9. ;how the other controls work).
  10.  
  11. ;In library;scroll-bar-dialog-items.lisp, patch the following:
  12.  
  13.  
  14. (defmethod install-view-in-window :after ((item scroll-bar-dialog-item) view)
  15.   (declare (ignore view))
  16.   (let* ((window (view-window item))
  17.          (my-size (view-size item))
  18.          (my-position (view-position item))
  19.          (setting (scroll-bar-setting item))
  20.          (min (scroll-bar-min item))
  21.          (max (scroll-bar-max item)))
  22.     (when window
  23.       (rlet ((scroll-rect :rect))
  24.         (rset scroll-rect rect.topleft my-position)
  25.         (rset scroll-rect rect.bottomright (add-points my-position my-size))
  26.         (when (dialog-item-handle item)
  27.           (_DisposControl :ptr (dialog-item-handle item)))
  28.         (setf (dialog-item-handle item)
  29.               (_NewControl :ptr (wptr item)   ;window
  30.                            :ptr scroll-rect   ;item rectangle
  31.                            :ptr (%null-ptr)   ;title
  32.                            :boolean nil       ;visible-p: invisible initially.
  33.                            :word setting      ;initial value
  34.                            :word min  ;min value
  35.                            :word max  ;max value
  36.                            :word 16           ;type of control
  37.                            :long 0            ;refcon
  38.                            :ptr))
  39.         (unless (window-active-p window)
  40.           (view-deactivate-event-handler item))))))
  41.  
  42. (defmethod view-draw-contents ((item scroll-bar-dialog-item))
  43.   (let ((handle (dialog-item-handle item)))
  44.     (when handle
  45.       (if (rref handle :control.vis)
  46.         (_Draw1Control :ptr handle)
  47.         (_ShowControl :ptr handle)))))
  48.